.class public final Llt/noframe/ratemeplease/social/FacebookProcessor;
.super Ljava/lang/Object;
.source "FacebookProcessor.kt"

# interfaces
.implements Landroid/app/Application$ActivityLifecycleCallbacks;


# instance fields
.field private final TAG:Ljava/lang/String;

.field private activity:Landroid/app/Activity;

.field private appinviteCallback:Lcom/facebook/FacebookCallback;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lcom/facebook/FacebookCallback<",
            "Lcom/facebook/share/widget/AppInviteDialog$Result;",
            ">;"
        }
    .end annotation
.end field

.field private likeCallback:Lcom/facebook/FacebookCallback;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lcom/facebook/FacebookCallback<",
            "Lcom/facebook/share/internal/LikeDialog$Result;",
            ">;"
        }
    .end annotation
.end field

.field private mCallbackManager:Lcom/facebook/CallbackManager;

.field private shareCallback:Lcom/facebook/FacebookCallback;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lcom/facebook/FacebookCallback<",
            "Lcom/facebook/share/Sharer$Result;",
            ">;"
        }
    .end annotation
.end field


# direct methods
.method public constructor <init>(Landroid/app/Activity;)V
    .locals 1

    const-string v0, "activity"

    invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    .line 25
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    iput-object p1, p0, Llt/noframe/ratemeplease/social/FacebookProcessor;->activity:Landroid/app/Activity;

    const-string p1, "FacebookProcessor"

    .line 26
    iput-object p1, p0, Llt/noframe/ratemeplease/social/FacebookProcessor;->TAG:Ljava/lang/String;

    .line 46
    invoke-static {}, Lcom/facebook/CallbackManager$Factory;->create()Lcom/facebook/CallbackManager;

    move-result-object p1

    const-string v0, "CallbackManager.Factory.create()"

    invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    iput-object p1, p0, Llt/noframe/ratemeplease/social/FacebookProcessor;->mCallbackManager:Lcom/facebook/CallbackManager;

    .line 49
    iget-object p1, p0, Llt/noframe/ratemeplease/social/FacebookProcessor;->activity:Landroid/app/Activity;

    invoke-virtual {p1}, Landroid/app/Activity;->getApplication()Landroid/app/Application;

    move-result-object p1

    invoke-virtual {p1, p0}, Landroid/app/Application;->registerActivityLifecycleCallbacks(Landroid/app/Application$ActivityLifecycleCallbacks;)V

    .line 106
    new-instance p1, Llt/noframe/ratemeplease/social/FacebookProcessor$appinviteCallback$1;

    invoke-direct {p1, p0}, Llt/noframe/ratemeplease/social/FacebookProcessor$appinviteCallback$1;-><init>(Llt/noframe/ratemeplease/social/FacebookProcessor;)V

    iput-object p1, p0, Llt/noframe/ratemeplease/social/FacebookProcessor;->appinviteCallback:Lcom/facebook/FacebookCallback;

    .line 120
    new-instance p1, Llt/noframe/ratemeplease/social/FacebookProcessor$shareCallback$1;

    invoke-direct {p1, p0}, Llt/noframe/ratemeplease/social/FacebookProcessor$shareCallback$1;-><init>(Llt/noframe/ratemeplease/social/FacebookProcessor;)V

    iput-object p1, p0, Llt/noframe/ratemeplease/social/FacebookProcessor;->shareCallback:Lcom/facebook/FacebookCallback;

    .line 134
    new-instance p1, Llt/noframe/ratemeplease/social/FacebookProcessor$likeCallback$1;

    invoke-direct {p1, p0}, Llt/noframe/ratemeplease/social/FacebookProcessor$likeCallback$1;-><init>(Llt/noframe/ratemeplease/social/FacebookProcessor;)V

    iput-object p1, p0, Llt/noframe/ratemeplease/social/FacebookProcessor;->likeCallback:Lcom/facebook/FacebookCallback;

    return-void
.end method


# virtual methods
.method public final getTAG()Ljava/lang/String;
    .locals 1

    .line 26
    iget-object v0, p0, Llt/noframe/ratemeplease/social/FacebookProcessor;->TAG:Ljava/lang/String;

    return-object v0
.end method

.method public onActivityCreated(Landroid/app/Activity;Landroid/os/Bundle;)V
    .locals 0

    return-void
.end method

.method public onActivityDestroyed(Landroid/app/Activity;)V
    .locals 0

    return-void
.end method

.method public onActivityPaused(Landroid/app/Activity;)V
    .locals 1

    if-eqz p1, :cond_0

    .line 39
    sget-object v0, Llt/noframe/ratemeplease/Conf;->Companion:Llt/noframe/ratemeplease/Conf$Companion;

    invoke-virtual {v0}, Llt/noframe/ratemeplease/Conf$Companion;->getIns()Llt/noframe/ratemeplease/Conf;

    move-result-object v0

    invoke-virtual {v0}, Llt/noframe/ratemeplease/Conf;->getFacebookPageId()Ljava/lang/String;

    move-result-object v0

    invoke-static {p1, v0}, Lcom/facebook/appevents/AppEventsLogger;->deactivateApp(Landroid/content/Context;Ljava/lang/String;)V

    return-void

    :cond_0
    invoke-static {}, Lkotlin/jvm/internal/Intrinsics;->throwNpe()V

    const/4 p1, 0x0

    throw p1
.end method

.method public final onActivityResult(IILandroid/content/Intent;)V
    .locals 1

    .line 103
    iget-object v0, p0, Llt/noframe/ratemeplease/social/FacebookProcessor;->mCallbackManager:Lcom/facebook/CallbackManager;

    invoke-interface {v0, p1, p2, p3}, Lcom/facebook/CallbackManager;->onActivityResult(IILandroid/content/Intent;)Z

    return-void
.end method

.method public onActivityResumed(Landroid/app/Activity;)V
    .locals 1

    if-eqz p1, :cond_0

    .line 43
    sget-object v0, Llt/noframe/ratemeplease/Conf;->Companion:Llt/noframe/ratemeplease/Conf$Companion;

    invoke-virtual {v0}, Llt/noframe/ratemeplease/Conf$Companion;->getIns()Llt/noframe/ratemeplease/Conf;

    move-result-object v0

    invoke-virtual {v0}, Llt/noframe/ratemeplease/Conf;->getFacebookPageId()Ljava/lang/String;

    move-result-object v0

    invoke-static {p1, v0}, Lcom/facebook/appevents/AppEventsLogger;->activateApp(Landroid/content/Context;Ljava/lang/String;)V

    return-void

    :cond_0
    invoke-static {}, Lkotlin/jvm/internal/Intrinsics;->throwNpe()V

    const/4 p1, 0x0

    throw p1
.end method

.method public onActivitySaveInstanceState(Landroid/app/Activity;Landroid/os/Bundle;)V
    .locals 0

    return-void
.end method

.method public onActivityStarted(Landroid/app/Activity;)V
    .locals 0

    return-void
.end method

.method public onActivityStopped(Landroid/app/Activity;)V
    .locals 0

    return-void
.end method

.method public final sendMessage(Ljava/lang/String;)V
    .locals 2

    const-string v0, "messageText"

    invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    .line 53
    iget-object v0, p0, Llt/noframe/ratemeplease/social/FacebookProcessor;->activity:Landroid/app/Activity;

    sget-object v1, Llt/noframe/ratemeplease/Const;->INSTANCE:Llt/noframe/ratemeplease/Const;

    invoke-virtual {v1}, Llt/noframe/ratemeplease/Const;->getMESSENGER_PACKAGE_NAME()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Llt/noframe/ratemeplease/utils/UtilsKt;->isPackageExists(Landroid/content/Context;Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_0

    .line 54
    new-instance v0, Landroid/content/Intent;

    invoke-direct {v0}, Landroid/content/Intent;-><init>()V

    const-string v1, "android.intent.action.SEND"

    .line 55
    invoke-virtual {v0, v1}, Landroid/content/Intent;->setAction(Ljava/lang/String;)Landroid/content/Intent;

    const-string v1, "android.intent.extra.TEXT"

    .line 56
    invoke-virtual {v0, v1, p1}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    const-string p1, "text/plain"

    .line 57
    invoke-virtual {v0, p1}, Landroid/content/Intent;->setType(Ljava/lang/String;)Landroid/content/Intent;

    .line 58
    sget-object p1, Llt/noframe/ratemeplease/Const;->INSTANCE:Llt/noframe/ratemeplease/Const;

    invoke-virtual {p1}, Llt/noframe/ratemeplease/Const;->getMESSENGER_PACKAGE_NAME()Ljava/lang/String;

    move-result-object p1

    invoke-virtual {v0, p1}, Landroid/content/Intent;->setPackage(Ljava/lang/String;)Landroid/content/Intent;

    .line 59
    iget-object p1, p0, Llt/noframe/ratemeplease/social/FacebookProcessor;->activity:Landroid/app/Activity;

    invoke-virtual {p1, v0}, Landroid/app/Activity;->startActivity(Landroid/content/Intent;)V

    goto :goto_0

    .line 61
    :cond_0
    iget-object p1, p0, Llt/noframe/ratemeplease/social/FacebookProcessor;->activity:Landroid/app/Activity;

    const/4 v0, 0x0

    const-string v1, "Facebook Messenger isn\'t installed"

    invoke-static {p1, v1, v0}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;

    move-result-object p1

    invoke-virtual {p1}, Landroid/widget/Toast;->show()V

    :goto_0
    return-void
.end method

.method public final showShareDialog(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
    .locals 4

    const-string v0, "shareAppId"

    invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    .line 79
    new-instance v0, Lcom/facebook/share/widget/ShareDialog;

    iget-object v1, p0, Llt/noframe/ratemeplease/social/FacebookProcessor;->activity:Landroid/app/Activity;

    invoke-direct {v0, v1}, Lcom/facebook/share/widget/ShareDialog;-><init>(Landroid/app/Activity;)V

    .line 80
    iget-object v1, p0, Llt/noframe/ratemeplease/social/FacebookProcessor;->mCallbackManager:Lcom/facebook/CallbackManager;

    iget-object v2, p0, Llt/noframe/ratemeplease/social/FacebookProcessor;->shareCallback:Lcom/facebook/FacebookCallback;

    invoke-virtual {v0, v1, v2}, Lcom/facebook/internal/FacebookDialogBase;->registerCallback(Lcom/facebook/CallbackManager;Lcom/facebook/FacebookCallback;)V

    .line 83
    new-instance v1, Lcom/facebook/share/model/ShareLinkContent$Builder;

    invoke-direct {v1}, Lcom/facebook/share/model/ShareLinkContent$Builder;-><init>()V

    .line 84
    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    sget-object v3, Llt/noframe/ratemeplease/Const;->INSTANCE:Llt/noframe/ratemeplease/Const;

    invoke-virtual {v3}, Llt/noframe/ratemeplease/Const;->getFACEBOOK_BASE()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p1

    invoke-static {p1}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object p1

    invoke-virtual {v1, p1}, Lcom/facebook/share/model/ShareContent$Builder;->setContentUrl(Landroid/net/Uri;)Lcom/facebook/share/model/ShareContent$Builder;

    if-eqz p2, :cond_0

    .line 87
    invoke-virtual {v1, p2}, Lcom/facebook/share/model/ShareLinkContent$Builder;->setContentTitle(Ljava/lang/String;)Lcom/facebook/share/model/ShareLinkContent$Builder;

    :cond_0
    if-eqz p3, :cond_1

    .line 90
    invoke-static {p3}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object p1

    invoke-virtual {v1, p1}, Lcom/facebook/share/model/ShareLinkContent$Builder;->setImageUrl(Landroid/net/Uri;)Lcom/facebook/share/model/ShareLinkContent$Builder;

    :cond_1
    if-eqz p4, :cond_2

    .line 93
    invoke-virtual {v1, p4}, Lcom/facebook/share/model/ShareLinkContent$Builder;->setContentDescription(Ljava/lang/String;)Lcom/facebook/share/model/ShareLinkContent$Builder;

    .line 95
    :cond_2
    invoke-virtual {v1}, Lcom/facebook/share/model/ShareLinkContent$Builder;->build()Lcom/facebook/share/model/ShareLinkContent;

    move-result-object p1

    const-string p2, "builder.build()"

    invoke-static {p1, p2}, Lkotlin/jvm/internal/Intrinsics;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    .line 97
    invoke-virtual {v0, p1}, Lcom/facebook/internal/FacebookDialogBase;->canShow(Ljava/lang/Object;)Z

    move-result p2

    if-eqz p2, :cond_3

    .line 98
    sget-object p2, Lcom/facebook/share/widget/ShareDialog$Mode;->NATIVE:Lcom/facebook/share/widget/ShareDialog$Mode;

    invoke-virtual {v0, p1, p2}, Lcom/facebook/share/widget/ShareDialog;->show(Lcom/facebook/share/model/ShareContent;Lcom/facebook/share/widget/ShareDialog$Mode;)V

    :cond_3
    return-void
.end method
